﻿using BLL;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace WebApi.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class AdminController : ControllerBase
    {
        public AdminController(Admin_BLL Bll)
        {
            this.Bll = Bll;
        }

        public Admin_BLL Bll { get; }

        /// <summary>
        /// 管理员登录
        /// </summary>
        /// <param name="Name"></param>
        /// <param name="Pwd"></param>
        /// <returns></returns>
        [HttpPost("Login")]
        public IActionResult Login(string? Name, string? Pwd)
        {
            var m= Bll.Login(Name, Pwd);
            return Ok(new
            {
                data = m
            });

        }

    }
}
